package com.astrakit.common.exception;

import com.astrakit.common.api.ErrorCode;

/**
 * Created with IntelliJ IDEA.
 * Description:做渐进主义的改良派,不做完美主义的速成派
 * User: XALEXC
 * Date: 2025-08-20
 * Time: 21:23
 */

public class BusinessException extends RuntimeException {
    private final int code;

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
    }

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
